Skip to content

Conversation

@Palanikannan1437
Copy link
Member

@Palanikannan1437 Palanikannan1437 commented Dec 1, 2025

Description

Refactored the entire image uploader flow to make it more reliable and easier to maintain. The changes clean up old upload logic, remove duplicated handlers, and unify how images are processed across create/edit views. This also reduces unnecessary re-renders and fixes edge-cases where images wouldn’t properly update after replacement.

Type of Change

  • Code refactoring
  • Improvement

Screenshots and Media (if applicable)

N/A

Test Scenarios

  • Tested uploading, replacing, and deleting images across all supported formats.
  • Verified drag-and-drop and paste-to-upload flows.
  • Ensured updated components render correctly without stale states.
  • Confirmed no regressions in existing image handling UX.

References

Improves overall reliability of the image upload experience.

Summary by CodeRabbit

  • Bug Fixes

    • Prevented duplicate image upload attempts on mount.
  • New Features

    • Block menu accepts additional icon formats for richer icon display.
    • Drag/drop and paste now respect newly flagged extensions for file handling.
  • Refactor

    • Optimized file-deletion processing for improved performance.
    • Simplified callout logo selection for more reliable logo handling.
    • Updated asset restore/restore endpoint usage to a new anchor-based path.

✏️ Tip: You can customize this high-level summary in your review settings.

@cursor
Copy link

cursor bot commented Dec 1, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 20.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@makeplane
Copy link

makeplane bot commented Dec 1, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

Refactors logo selector value handling; prevents duplicate uploads on mount in image uploader; consolidates file deletion detection into a single pass with an early-exit; expands icon typing for block menu; threads a new flaggedExtensions option through UtilityExtension and DropHandlerPlugin and updated drop/file-insert call sites; changes an asset restore endpoint parameter and updates SitesFileService restore URL and signature.

Changes

Cohort / File(s) Summary
Logo selector refactor
packages/editor/src/core/extensions/callout/logo-selector.tsx
Extracts val.value into local emojiValue and iconValue constants and replaces repeated direct val.value usage in data attributes and localStorage payloads.
Image uploader mount guard
packages/editor/src/core/extensions/custom-image/components/uploader.tsx
Adds hasTriedUploadingOnMountRef to avoid repeated mount uploads; moves meta retrieval into the effect; guards and marks attempts (drop vs insert); updates effect dependencies to imageEntityId, isTouchDevice, uploadFile, and imageComponentImageFileMap.
File deletion consolidation
packages/editor/src/core/plugins/file/delete.ts
Adds early exit for CORE_EDITOR_META.SKIP_FILE_DELETION; replaces per-transaction removal checks with a single pass comparing oldState to newFileSources to collect removedFiles, then performs unified deletion handling and storage updates.
Block menu icon typing
packages/editor/src/core/components/menus/block-menu.tsx
Expands BlockMenuOption.icon type to accept either a LucideIcon or a React functional component with ISvgIcons props; adds ISvgIcons import.
UtilityExtension flaggedExtensions plumbing
packages/editor/src/core/extensions/extensions.ts
packages/editor/src/core/extensions/utility.ts
flaggedExtensions is now passed into UtilityExtension and added to Props; propagated into DropHandlerPlugin configuration. Props type signature updated to include flaggedExtensions.
Drop handler flaggedExtensions
packages/editor/src/core/plugins/drop.ts
Adds optional flaggedExtensions to Props; threads flaggedExtensions into paste/drop handling and into insertFilesSafely; updates InsertFilesSafelyArgs and call sites to accept optional flaggedExtensions.
Asset restore endpoint signature
apps/api/plane/space/views/asset.py
Changes AssetRestoreEndpoint.post parameter from asset_id to pk and looks up the asset by id=pk; adds import get_asset_object_metadata (import added but not used in-diff).
Sites file service restore URL/signature
packages/services/src/file/sites-file.service.ts
Changes restoreNewAsset signature from (workspaceSlug: string, src: string) to (anchor: string, src: string) and updates the POST URL to /api/public/assets/v2/anchor/${anchor}/restore/${assetId}/.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify uploader effect logic and refs (hasTriedUploadingOnMountRef, hasOpenedFileInputOnce) for edge cases and closure capture.
  • Confirm file deletion single-pass detects all removed files and preserves transactional semantics and error handling.
  • Ensure flaggedExtensions is consistently threaded and typed across plugins and call sites.
  • Review backend change: AssetRestoreEndpoint.post parameter rename (asset_idpk) and the added import for unintended side effects.
  • Check updated SitesFileService.restoreNewAsset signature and consumer call sites for compatibility.

Poem

🐰 I nibbled values, named them neat and small,
A watchful paw kept uploads from a fall,
I swept out ghosts of files with one long hop,
Flags now travel where the handlers stop —
Hoppity-hop, the code feels springtime’s call. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title is partially related to the changeset. While it mentions 'refactor image uploader', the PR actually contains broader changes including refactoring of logo selector, file deletion logic, block menu types, utility extensions, and drop handler plugins—far beyond just the image uploader. Consider revising the title to better reflect the full scope of changes, such as '[WIKI-804] refactor: image uploader, file handling, and extension utilities' or split into multiple focused PRs.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description is mostly complete and follows the template structure with all required sections filled. It provides context about the refactoring goals, marks appropriate change types, includes test scenarios, and references the issue.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/refactor-images

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8733acb and 0aafa94.

📒 Files selected for processing (2)
  • apps/api/plane/space/views/asset.py (2 hunks)
  • packages/services/src/file/sites-file.service.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • packages/services/src/file/sites-file.service.ts
🧬 Code graph analysis (2)
packages/services/src/file/sites-file.service.ts (3)
packages/services/src/file/helper.ts (1)
  • getAssetIdFromUrl (82-86)
apps/space/helpers/file.helper.ts (1)
  • getAssetIdFromUrl (21-25)
packages/utils/src/file.ts (1)
  • getAssetIdFromUrl (21-27)
apps/api/plane/space/views/asset.py (1)
apps/api/plane/db/models/asset.py (1)
  • FileAsset (24-96)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/api/plane/space/views/asset.py (1)

14-19: Import placement and usage look good

The new get_asset_object_metadata import and the grouping under “Module imports” are consistent with the rest of the file and correctly back the EntityAssetEndpoint.patch usage (get_asset_object_metadata.delay(...)). No further changes needed here.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

aaryan610
aaryan610 previously approved these changes Dec 1, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/editor/src/core/extensions/custom-image/components/uploader.tsx (1)

130-150: Verify guard ref is set for all code paths.

The hasTriedUploadingOnMountRef is set for the "drop" event (line 137) and when no meta exists (line 148), but not for the "insert" event path (lines 139-146). This could allow the effect to re-run for "insert" scenarios if the component re-mounts.

While hasOpenedFileInputOnce provides some protection (line 140), consider setting hasTriedUploadingOnMountRef.current = true after line 145 for consistency:

         hasTriggeredFilePickerRef.current = true;
         imageComponentImageFileMap?.set(imageEntityId ?? "", { ...meta, hasOpenedFileInputOnce: true });
+        hasTriedUploadingOnMountRef.current = true;
       }
     } else {
       hasTriedUploadingOnMountRef.current = true;
     }

This ensures all code paths set the guard, preventing potential duplicate effects across all scenarios.

🧹 Nitpick comments (1)
packages/editor/src/core/plugins/file/delete.ts (1)

52-67: Consider using for...of instead of forEach with async callback.

The forEach loop doesn't await the async callback, causing deletions to run in parallel without coordination. While error handling is present, this pattern can lead to unhandled promise rejections or race conditions.

Apply this diff to properly await all deletions:

-      removedFiles.forEach(async (node) => {
+      for (const node of removedFiles) {
         const nodeType = node.type.name as keyof NodeFileMapType;
         const src = node.attrs.src;
         const nodeFileSetDetails = NODE_FILE_MAP[nodeType];
         if (!nodeFileSetDetails || !src) return;
         try {
           editor.storage[nodeType]?.[nodeFileSetDetails.fileSetName]?.set(src, true);
           // update assets list storage value
           editor.commands.updateAssetsList?.({
             idToRemove: node.attrs.id,
           });
           await deleteHandler(src);
         } catch (error) {
           console.error("Error deleting file via delete utility plugin:", error);
         }
-      });
+      }

Alternatively, if parallel execution is intentional, use Promise.allSettled to properly track completion:

-      removedFiles.forEach(async (node) => {
+      await Promise.allSettled(removedFiles.map(async (node) => {
         const nodeType = node.type.name as keyof NodeFileMapType;
         const src = node.attrs.src;
         const nodeFileSetDetails = NODE_FILE_MAP[nodeType];
         if (!nodeFileSetDetails || !src) return;
         try {
           editor.storage[nodeType]?.[nodeFileSetDetails.fileSetName]?.set(src, true);
           // update assets list storage value
           editor.commands.updateAssetsList?.({
             idToRemove: node.attrs.id,
           });
           await deleteHandler(src);
         } catch (error) {
           console.error("Error deleting file via delete utility plugin:", error);
         }
-      });
+      }));
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cea6f75 and b011100.

📒 Files selected for processing (3)
  • packages/editor/src/core/extensions/callout/logo-selector.tsx (1 hunks)
  • packages/editor/src/core/extensions/custom-image/components/uploader.tsx (3 hunks)
  • packages/editor/src/core/plugins/file/delete.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • packages/editor/src/core/extensions/callout/logo-selector.tsx
  • packages/editor/src/core/extensions/custom-image/components/uploader.tsx
  • packages/editor/src/core/plugins/file/delete.ts
🧬 Code graph analysis (1)
packages/editor/src/core/extensions/custom-image/components/uploader.tsx (1)
packages/services/src/file/file-upload.service.ts (1)
  • uploadFile (24-41)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
packages/editor/src/core/extensions/callout/logo-selector.tsx (2)

54-67: LGTM: Clean extraction of emoji value.

Extracting the type-casted value to a local constant eliminates duplication and improves readability while maintaining type safety through the conditional guard.


68-81: LGTM: Clean extraction of icon value.

Extracting the type-casted value to a local constant eliminates duplication and improves readability while maintaining type safety through the conditional guard.

packages/editor/src/core/plugins/file/delete.ts (2)

24-24: LGTM: Efficient early exit guard.

The skip check prevents unnecessary deletion processing when the SKIP_FILE_DELETION meta flag is set, improving performance and clarity.


38-50: LGTM: Efficient consolidation of removal detection.

Collecting removed files in a single pass over the old state is more efficient than the previous per-transaction approach and improves code clarity.

packages/editor/src/core/extensions/custom-image/components/uploader.tsx (1)

43-43: LGTM: Guard ref prevents duplicate mount uploads.

The hasTriedUploadingOnMountRef follows React best practices for preventing duplicate effects in strict mode or during re-mounts.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b011100 and 8733acb.

📒 Files selected for processing (4)
  • packages/editor/src/core/components/menus/block-menu.tsx (2 hunks)
  • packages/editor/src/core/extensions/extensions.ts (1 hunks)
  • packages/editor/src/core/extensions/utility.ts (2 hunks)
  • packages/editor/src/core/plugins/drop.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • packages/editor/src/core/plugins/drop.ts
  • packages/editor/src/core/extensions/utility.ts
  • packages/editor/src/core/components/menus/block-menu.tsx
  • packages/editor/src/core/extensions/extensions.ts
🧠 Learnings (2)
📚 Learning: 2025-11-25T10:18:05.172Z
Learnt from: CR
Repo: makeplane/plane PR: 0
File: .github/instructions/typescript.instructions.md:0-0
Timestamp: 2025-11-25T10:18:05.172Z
Learning: Applies to **/*.{ts,tsx,mts,cts} : Use `.ts`, `.mts`, `.cts` extensions in `import type` statements (TypeScript 5.2+)

Applied to files:

  • packages/editor/src/core/extensions/utility.ts
📚 Learning: 2025-10-09T20:42:31.843Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7922
File: apps/admin/app/(all)/(dashboard)/ai/form.tsx:19-19
Timestamp: 2025-10-09T20:42:31.843Z
Learning: In the makeplane/plane repository, React types are globally available through TypeScript configuration. Type annotations like React.FC, React.ReactNode, etc. can be used without explicitly importing the React namespace. The codebase uses the modern JSX transform, so React imports are not required for JSX or type references.

Applied to files:

  • packages/editor/src/core/components/menus/block-menu.tsx
🧬 Code graph analysis (1)
packages/editor/src/core/extensions/utility.ts (2)
packages/editor/src/core/types/editor.ts (1)
  • IEditorProps (142-171)
packages/editor/src/core/types/config.ts (1)
  • TFileHandler (5-22)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
packages/editor/src/core/components/menus/block-menu.tsx (2)

15-15: LGTM!

The import correctly uses import type for the type-only import, following TypeScript best practices.


31-31: No issues found. The ISvgIcons interface properly extends React.SVGAttributes<SVGElement> and explicitly includes className?: string | undefined, making the type expansion at line 31 fully compatible with the usage at line 241.

packages/editor/src/core/extensions/extensions.ts (1)

41-56: flaggedExtensions is correctly threaded through CoreEditorExtensions

The addition of flaggedExtensions to TArguments and its propagation into UtilityExtension (and CoreEditorAdditionalExtensions) looks consistent with IEditorProps and keeps the core extension wiring cohesive. No functional issues spotted here; just ensure all call sites constructing CoreEditorExtensions now reliably provide flaggedExtensions alongside disabledExtensions so the downstream plugins see a coherent view of extension state.

If you want, you can run a quick search to confirm all CoreEditorExtensions( invocations now pass flaggedExtensions from IEditorProps/editor props. A simple rg -n "CoreEditorExtensions\(" -C3 in the repo should help verify this.

Also applies to: 58-72, 116-123

packages/editor/src/core/extensions/utility.ts (1)

54-58: Good centralization of flaggedExtensions in UtilityExtension

Using Pick<IEditorProps, "disabledExtensions" | "flaggedExtensions" | "getEditorMetaData"> for Props and forwarding flaggedExtensions into DropHandlerPlugin is a clean way to keep the drop/paste pipeline in sync with the editor’s top‑level configuration. This wiring looks correct and matches the intended API surface; the remaining work is just to ensure DropHandlerPlugin/insertFilesSafely actually make use of flaggedExtensions as designed (see comments in drop.ts).

If you later evolve the semantics of flaggedExtensions, this is the right choke point to add any additional plugins or behaviors that depend on it; just double‑check that all editor entry points constructing UtilityExtension pass consistent flaggedExtensions from IEditorProps.

Also applies to: 60-62, 80-84

Comment on lines 8 to 16
type Props = {
disabledExtensions?: TExtensions[];
flaggedExtensions?: TExtensions[];
editor: Editor;
};

export const DropHandlerPlugin = (props: Props): Plugin => {
const { disabledExtensions, editor } = props;
const { disabledExtensions, flaggedExtensions, editor } = props;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n packages/editor/src/core/plugins/drop.ts

Repository: makeplane/plane

Length of output: 4973


🏁 Script executed:

# Search for all usages of flaggedExtensions in the file
rg "flaggedExtensions" packages/editor/src/core/plugins/drop.ts -A 2 -B 2

Repository: makeplane/plane

Length of output: 636


flaggedExtensions is passed to handlePaste but missing from handleDrop, and unused in insertFilesSafely

flaggedExtensions is properly passed to insertFilesSafely in handlePaste (line 37) but missing from the handleDrop call (lines 70–76). Additionally, flaggedExtensions is defined in InsertFilesSafelyArgs but never destructured or used inside insertFilesSafely (line 98 only destructures disabledExtensions, not flaggedExtensions), making the new parameter dead code.

This creates an inconsistency: when behavior is added to insertFilesSafely that depends on flaggedExtensions, it will only apply to paste events, not drag-and-drop events. Add flaggedExtensions to the handleDrop call to match handlePaste, and ensure insertFilesSafely actually uses it once the logic is implemented.

🤖 Prompt for AI Agents
In packages/editor/src/core/plugins/drop.ts around lines 8 to 16 and related
spots (handlePaste at ~line 37, handleDrop at ~lines 70–76, and
insertFilesSafely definition at ~line 98), flaggedExtensions is passed to
handlePaste but omitted from handleDrop and never destructured/used in
insertFilesSafely; update the handleDrop call to include flaggedExtensions
alongside disabledExtensions and editor so both paste and drop flows receive the
same args, and modify insertFilesSafely's parameter destructuring to include
flaggedExtensions (and wire it into the function body or placeholder where the
future logic will use it) so the parameter is not dead code and both paste and
drop behaviors remain consistent.

@sriramveeraghanta sriramveeraghanta merged commit 82c970a into preview Dec 5, 2025
6 of 7 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix/refactor-images branch December 5, 2025 07:50
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* fix: refactor uploader

* fix: props

* fix: sites fix
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* fix: refactor uploader

* fix: props

* fix: sites fix
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* fix: refactor uploader

* fix: props

* fix: sites fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants